<template>
	<view>
		<u-navbar
			class="navbar"
			:title="title"
			titleStyle="font-size: 32rpx;font-weight: 700;"
			@rightClick="rightClick"
			:autoBack="true">
			<view v-if="showRight" slot="right">
				<view class="navbar-right">
					<u-button 
						type="primary" 
						size="small" 
						plain
						:customStyle="{border: 0}" >
						<text class="iconfontcomm icon-add"></text>
						{{ text }}
					</u-button>
				</view>
			</view>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		name:"navbar",
		props: {
			title: {
				type: String,
				default: ''
			},
			type: {
				type: String,
				default: ''
			},
			text: {
				type: String,
				default: 'report'
			},
			showRight: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			rightClick() {
				// this.$emit('rightClick', 'report')
				this.$common.openUrl('/packages/' + this.type + '/create')
			}
		}
	}
</script>

<style lang="scss" scoped>
.navbar {
	&-right {
		color: $u-primary;
		font-size: 28rpx;
		display: flex;
		align-items: center;
		.icon-add {
			font-size: 16rpx;
			margin-right: 6rpx;
		}
	}
}
</style>